package com.briup.app01.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.briup.app01.bean.Activity;

public interface ActivityMapper {
	
	@Insert("insert into cst_activity(atv_id,atv_cust_name,atv_place)"+"values(#{atvId},#{atvcustName},#{atvPlace})")
	public void save(Activity activity);
	
	@Delete("delete from cst_activity where id=#{id}")
	public void deleteById(int id);
	
	@Update("update cst_activity set atv_cust_name=#{atvcustName}," + "atv_place=#{atvPlace},"
	)
	public void update(Activity activity);
	
	@Select("select * from cst_activity where atv_id=#{id}")
	
	@Results({@Result(column = "atv_id",property = "atvId"),
		@Result(column = "atv_cust_name",property = "atvcustName"),
		@Result(column = "atv_place",property = "atvPlace"),
	})

	public Activity selectById(int id);
	
	@Select("select * from cst_activity")
	@Results({@Result(column = "atv_id",property = "atvId"),
		@Result(column = "atv_cust_name",property = "atvcustName"),
		@Result(column = "atv_place",property = "atvPlace"),
	})
	public List<Activity> selectAll();

}
